Skip to content

Conversation

@m-maillot
Copy link
Contributor

No description provided.

@m-maillot m-maillot requested review from Viczei and maxgfr October 16, 2025 09:13
@revu-bot revu-bot bot requested a review from revu-bot October 16, 2025 09:13
@m-maillot m-maillot temporarily deployed to build-preproduction October 16, 2025 09:13 — with GitHub Actions Inactive
@m-maillot m-maillot changed the title test: modification des tests depuis l'admin fix(accessibilite): accessibilité: ajout du bilan 2024 rendu accessible Oct 16, 2025
Copy link
Collaborator

@revu-bot revu-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds a new "Resume" component to display annual reports on the stats page. The implementation is functional but has several issues:

CRITICAL:

  • Hardcoded data in production code (year, filename, file size) should be dynamic or configurable
  • Missing accessibility: empty imageAlt prop violates WCAG guidelines

IMPORTANT:

  • Snapshot test doesn't verify actual component behavior - it only captures HTML output
  • No unit tests for the new Resume component
  • Typo in image filename ("modeles-de-courriers" should likely be "modeles-de-courrier")

The changes follow the existing code style but need improvements in testability, accessibility, and data management.

title={`Télécharger le bilan annuel de l’année ${year}`}
titleAs={`h3`}
detail={<p>Format PDF - {fileSizeMb}Mo</p>}
imageAlt={""}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL - Accessibility violation: Empty imageAlt prop fails WCAG accessibility standards. All images must have meaningful alternative text for screen readers. Consider using a descriptive alt text like 'Icône de téléchargement de document PDF' or make this decorative by using aria-hidden="true" on the image if the download context is already clear from the title.

Suggested change
imageAlt={""}
imageAlt={"Icône de téléchargement de document PDF"}

enlargeLinkOrButton
imageSvg={false}
small
imageUrl={`/static/assets/img/modeles-de-courriers-download.svg`}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR - Potential typo: The filename contains 'modeles-de-courriers-download.svg' with 'courriers' (plural). Verify if this should be 'courrier' (singular) to match French grammar conventions, as 'modèle de courrier' is the standard form.

Suggested change
imageUrl={`/static/assets/img/modeles-de-courriers-download.svg`}
imageUrl={`/static/assets/img/modeles-de-courrier-download.svg`}

@sonarqubecloud
Copy link

Copy link
Collaborator

@revu-bot revu-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An error occurred: Error processing line comments: GitHub API error (422): {"message":"Validation Failed","errors":[{"resource":"PullRequestReviewComment","code":"custom","field":"pull_request_review_thread.line","message":"could not be resolved"}],"documentation_url":"https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request","status":"422"}. Comment params: path=packages/code-du-travail-frontend/src/modules/stats/index.tsx, line=11, startLine=6

Revu logs

@tokenbureau
Copy link

tokenbureau bot commented Oct 16, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants